package com.zqu.service.impl;

import com.zqu.mapper.RoleMapper;
import com.zqu.pojo.Role;
import com.zqu.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired(required = false)
    private RoleMapper roleMapper;

    @Override
    public Role selectRoleById(long id) {
        return roleMapper.selectTById(id);
    }

    @Override
    public List<Role> selectList(Role role) {
        return roleMapper.selectList(role);
    }

    @Override
    public boolean insertRole(Role role) {
        return roleMapper.insertT(role)>0;
    }

    @Override
    public boolean updateRole(Role role) {
        return roleMapper.updateT(role)>0;
    }

    @Override
    public boolean deleteRole(long id) {
        return roleMapper.deleteT(id)>0;
    }

    @Override
    public boolean deleteRoleByIds(String[] ids) {
        return roleMapper.deleteTByIds(ids)>0;
    }
}
